/**
 * 
 */
package br.ufal.ic.sd.project.server.services;

import java.io.IOException;
import java.util.Properties;
import java.util.Set;

import br.ufal.ic.sd.project.server.core.Channel;
import br.ufal.ic.sd.project.server.core.Replicator;
import br.ufal.ic.sd.project.server.core.Server;
import br.ufal.ic.sd.project.server.core.ServerService;
import br.ufal.ic.sd.project.server.exception.ServerException;
import br.ufal.ic.sd.project.server.helper.Helper;
import br.ufal.ic.sd.project.server.util.Constants;

/**
 * @author keven andrade
 *
 */
public class ReplicationService extends ServerService{

    @Override
    public void executeService(Server objServer) {
	
	String strFileName = objServer.getObjChannel().read();
	String strFileContent = objServer.getObjChannel().read();
	
	Helper.createFile(Helper.getServerRepository(), strFileName, strFileContent);
	
	try {
	    objServer.getObjChannel().getObjClientSocket().close();
		
	} catch (IOException e) {
	    e.printStackTrace();
	}
	
    }

    public void reply(String strRepository, String strFileName) {
	
	
    }
    
}
